﻿//主视图
NotesApp.views.MainView = Ext.extend(Ext.Panel, {//Ext.extend Ext的继承，继承了Ext.Panel的prototype定义的方法
    fullscreen: true,//全屏显示
    layout: 'card',//card布局
    cardSwitchAnimation: 'slide',//panel切换动画
    initComponent: function () {//初始化
        Ext.apply(NotesApp.views, {//属性复制
            notesListView: new NotesApp.views.NotesListView({ notesStore: NotesApp.stores.notesStore }),
            noteEditorView: new NotesApp.views.NoteEditorView()
        });
        this.items = [//主视图添加两个panel
            NotesApp.views.notesListView,
            NotesApp.views.noteEditorView
        ]
        NotesApp.views.MainView.superclass.initComponent.call(this);
        this.on('render', function () {
            NotesApp.stores.notesStore.load();
        });
    }
});